/*
 * Copyright 2008,2009,2010 Daniel Freitas
 * 
 * This file is part of DMF Generic DAO.
 * 
 * DMF Generic DAO is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 * 
 * DMF Generic DAO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License along with DMF Generic DAO. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package com.googlecode.dmf.genericdao.spring;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;

import com.googlecode.dmf.genericdao.annotaions.Dao;

/**
 * A proxy factory that dynamically searches for annotated generic dao interfaces and register proxies for them in the
 * provided Spring bean registry.
 * 
 * @author <a href="mailto:daniel.mfreitas@gmail.com">Daniel Freitas</a>
 * 
 */
public interface ProxyDaoScannerFactory {

    /**
     * Scans the package tree, starting from the denoted base package name, for interfaces annotated with the
     * {@link Dao} annotation. For each interface, a proxy will be automatically created and added to the provided
     * Spring bean registry so they can be obtained from client code through Spring's application context.
     * 
     * @param packageName
     *            The base package to scan. The scan will traverse the whole package tree under the base name.
     * @param beanRegistry
     *            The bean registry where to add the proxy bean definitions.
     * 
     * @throws UnsupportedOperationException
     *             If the protocol of the URI for the base package is not supported by this proxy factory.
     */
    void createProxiesForDaos(String packageName, BeanDefinitionRegistry beanRegistry)
            throws UnsupportedOperationException;
}